/*
 * Copyright (c) 2015, the DeltaSync# project. All Rights Reserved.
 * This project is a C# port of the JDeltaSync project:
 *     http://jdeltasync.googlecode.com
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using System.Collections.Generic;
using System.Text;

/**
 */
public class SyncResponse {
    private List<Collection> collections;
    
    public SyncResponse(List<Collection> collections) {
        this.collections = collections;
    }

    public List<Collection> Collections {
        get { return collections; }
    }
    
    public override string ToString() {
        StringBuilder sb = new StringBuilder(base.ToString() + "(");
        sb.Append("collections").Append("=").Append(collections);
        sb.Append(")");
        return sb.ToString();
    }
    
    public class Collection {
        private string syncKey;
        private Clazz clazz;
        private int status;
        private List<Command> commands;
        private bool moreAvailable;
        private List<Response> responses;
        
        public Collection(string syncKey, Clazz clazz, int status,
                List<Command> commands, bool moreAvailable, 
                List<Response> responses) {
            
            this.syncKey = syncKey;
            this.clazz = clazz;
            this.status = status;
            this.commands = commands;
            this.moreAvailable = moreAvailable;
            this.responses = responses;
        }

        public string SyncKey {
            get { return syncKey; }
        }

        public Clazz Clazz {
            get { return clazz; }
        }

        public int Status {
            get { return status; }
        }

        public List<Command> Commands {
            get { return commands; }
        }

        public bool HasMoreAvailable {
            get { return moreAvailable; }
        }
        
        public List<Response> Responses {
            get { return responses; }
        }
        
        public abstract class Response {
        }
        
        public class EmailDeleteResponse : Response {
            private string id;
            private int    status;
            
            public EmailDeleteResponse(string id, int status) {
                this.id     = id;
                this.status = status;
            }
            
            public string Id {
                get { return id; }
            }
            
            public int Status {
                get { return status; }
            }
        }
    }
}
